﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" CodeFile="ContainerModelList.aspx.cs"
    Inherits="SystemManage_ContainerModelList" Title="柜型列表" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="title">
                <asp:Label ID="lblTitle" runat="server" Text="柜型列表" meta:resourcekey="lblTitleResource1"></asp:Label></div>
            <table class="add_table" cellspacing="1" cellpadding="3">
                <tr>                   
                    <td align="right">
                        <asp:DropDownList ID="ddlColumnName" runat="server" meta:resourcekey="ddlColumnNameResource1">
                            <asp:ListItem Text="柜型名称" Value="Model" meta:resourcekey="ListItemResource3"></asp:ListItem>
                            <asp:ListItem Text="体积上限" Value="VolUpperLimit" meta:resourcekey="ListItemResource4"></asp:ListItem>
                            <asp:ListItem Text="体积下限" Value="VolLowerLimit" meta:resourcekey="ListItemResource5"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server" meta:resourcekey="txtNameResource1"></asp:TextBox>
                    </td>
                    <td align="right">
                        <asp:Label ID="lblStatus" runat="server" Text="状态：" meta:resourcekey="lblStatusResource1"></asp:Label>
                    </td>
                    <td>
                        <asp:RadioButton ID="radAll" runat="server" Text="全部" Checked="True" GroupName="status"
                            meta:resourcekey="radAllResource1" />
                        <asp:RadioButton ID="radYes" runat="server" Text="有效" GroupName="status" meta:resourcekey="radYesResource1" /><asp:RadioButton
                            ID="radNo" runat="server" Text="失效" GroupName="status" meta:resourcekey="radNoResource1" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4" align="center">
                        <asp:Button ID="btnSearch" runat="server" CssClass="btn" Text="搜索" OnClick="btnSearch_Click"
                            meta:resourcekey="btnSearchResource1" />
                    </td>
                </tr>
            </table>
            <div id="divEntrust" runat="server">
                <div class="list_title">
                    <div class="autoleft">
                        &nbsp;<asp:Label ID="lblTotal" runat="server" meta:resourcekey="lblTotalResource1"></asp:Label>
                        <asp:Label ID="lblRecordFound" runat="server" Text="条记录" meta:resourcekey="lblRecordFoundResource1"></asp:Label>&nbsp;<a
                            href="ContainerModelAdd.aspx"><asp:Label ID="lblModelAdd" runat="server" Text="添加柜型"
                                meta:resourcekey="lblModeAddResource1"></asp:Label></a>&nbsp;<a
                            href="ContainerModelBatchImport.aspx"><asp:Label ID="lblImport" runat="server" Text="批量导入"
                                meta:resourcekey="lblImportResource1"></asp:Label></a></div>
                    <div class="autoright">
                        <asp:Label ID="lblPerPageDisplay" runat="server" Text="每页显示：" meta:resourcekey="lblPerPageDisplayResource1"></asp:Label>
                        <asp:DropDownList ID="ddlPages" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged"
                            meta:resourcekey="ddlPagesResource1">
                            <asp:ListItem Selected="True" Text="10" Value="10" meta:resourcekey="ListItemResource1"></asp:ListItem>
                            <asp:ListItem Text="15" Value="15" meta:resourcekey="ListItemResource2"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </div>
                <asp:GridView ID="gvContainerModelList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    Width="100%" AllowSorting="True" OnPageIndexChanging="gvContainerModelList_PageIndexChanging"
                    OnSorting="gvContainerModelList_Sorting" OnRowCommand="gvContainerModelList_RowCommand"
                    OnRowDataBound="gvContainerModelList_RowDataBound" meta:resourcekey="gvContainerModelListResource1" CssClass="tblGridView">
                    <PagerSettings Mode="NumericFirstLast" />
                    <PagerTemplate>
                        <table style="width: 100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblCurrentPage" runat="server" Text="页次" meta:resourcekey="lblCurrentPageResource1"></asp:Label>:&nbsp;<asp:Label
                                        ID="Label1" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1      %>'></asp:Label>/<asp:Label
                                            ID="Label2" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount %>'></asp:Label>&nbsp;
                                    <asp:Label ID="lblTotalPages" runat="server" Text="总计" meta:resourcekey="lblTotalPagesResource1"></asp:Label>:&nbsp;<asp:Label
                                        ID="Label3" runat="server" Text="<%# ((System.Data.DataView)gvContainerModelList.DataSource).Count %>"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Page" CommandArgument="First"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="首页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="Prev" CommandName="Page"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="前页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Page" CommandArgument="Next"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                        Text="后页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="Last" CommandName="Page"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                        Text="尾页"></asp:LinkButton>&nbsp;
                                    <asp:Label ID="lblTurnOn" runat="server" Text="转第" meta:resourcekey="lblTurnToResource1"></asp:Label><asp:TextBox
                                        ID="txtPages" runat="server" Width="35px"></asp:TextBox>
                                    <asp:Label ID="lblPages2" runat="server" Text="页" meta:resourcekey="lblPages2Resource1"></asp:Label>
                                    <asp:LinkButton ID="lbtnGo" runat="server" Text="提交" OnClick="lbtnGo_Click"></asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </PagerTemplate>
                    <Columns>
                      <%--  <asp:TemplateField HeaderText="编号" SortExpression="Code" meta:resourcekey="TemplateFieldResource1">
                            <ItemTemplate>
                                <asp:Label ID="lblCodes" runat="server" Text='<%# Eval("Code") %>' meta:resourcekey="lblCodesResource1"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                        
                          <asp:TemplateField HeaderText="序号" meta:resourcekey="TemplateFieldResourceRowNum1">
                            <ItemTemplate>
                                <asp:Label ID="lblRowNum" runat="server" Text='<%#(Container as GridViewRow).RowIndex + 1%>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="5%" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="柜型名称" SortExpression="Model" meta:resourcekey="TemplateFieldResource2">
                            <ItemTemplate>
                                <asp:Label ID="lblModel" runat="server" Text='<%# Eval("Model") %>' meta:resourcekey="lblModelResource2"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                     <%--   <asp:TemplateField HeaderText="类型" SortExpression="Type" meta:resourcekey="TemplateFieldResource3">
                            <ItemTemplate>
                                <asp:Label ID="lblType" runat="server" Text='<%# Eval("Type") %>' meta:resourcekey="lblTypeResource2"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="体积上限" SortExpression="VolUpperLimit" meta:resourcekey="TemplateFieldResource4">
                            <ItemTemplate>
                                <asp:Label ID="lblVolUpperLimit" runat="server" Text='<%# Eval("VolUpperLimit") %>'
                                    meta:resourcekey="lblVolUpperLimitResource1"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="体积下限" SortExpression="VolLowerLimit" meta:resourcekey="TemplateFieldResource5">
                            <ItemTemplate>
                                <asp:Label ID="lblVolLowerLimit" runat="server" Text='<%# Eval("VolLowerLimit") %>'
                                    meta:resourcekey="lblVolLowerLimitResource1"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="备注" SortExpression="Remark" meta:resourcekey="TemplateFieldResource6">
                            <ItemTemplate>
                                <asp:Label ID="lblRemark" runat="server" Text='<%# Eval("Remark") %>' meta:resourcekey="lblRemarkResource1"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="修改人" SortExpression="LastModUser" meta:resourcekey="TemplateFieldResource7">
                            <ItemTemplate>
                                <asp:Label ID="lblModifyUser" runat="server" Text='<%# GetUserName(Eval("LastModUser")) %>'
                                    meta:resourcekey="lblModifyUserResource1"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="修改时间" SortExpression="LastModDate" meta:resourcekey="TemplateFieldResource8">
                            <ItemTemplate>
                                <asp:Label ID="lblLastModDate" runat="server" Text='<%# String.Format("{0:yyyy-MM-dd}",Eval("LastModDate")) %>'
                                    meta:resourcekey="lblLastModDateResource1"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                          <asp:TemplateField HeaderText="状态" SortExpression="Status" 
                        meta:resourcekey="TemplateFieldResourceStatus">
                        <ItemTemplate>
                            <asp:Label ID="lblStatus" runat="server" 
                                Text='<%# HK2009.Common.StringUtil.GetStatus(Eval("Status")) %>' 
                                ></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="10%" />
                    </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作" meta:resourcekey="TemplateFieldResource9">
                            <ItemTemplate>
                                <a href='ContainerModelAdd.aspx?PKID=<%# Eval("PKID") %>'>
                                    <asp:Label ID="lblEdit" runat="server" Text="修改" meta:resourcekey="lblEditResource1"></asp:Label></a>
                                <asp:LinkButton ID="lbtnDel" runat="server" Text="删除" CommandArgument='<%# Eval("PKID") %>'
                                    OnClientClick='<%#"javascript:return confirm(\""+   Resources.Messages.DelRecord  +"\")"%>' CommandName="Del" meta:resourcekey="lbtnDelResource1"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Width="10%" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle HorizontalAlign="Center" />
                    <RowStyle HorizontalAlign="Center" />
                </asp:GridView>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <br />
    <div>
    <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Export to Excel" CssClass="btn" meta:resourcekey="Button2Resource2" />
    </div>
</asp:Content>
